use proc_macro2::TokenStream;
use quote::quote;
use syn::Item;
use syn::Result;

pub fn multipart_expand(item: Item) -> Result<TokenStream> {
    let expand = quote! {
        #[cfg_attr(feature = "rpc", derive(apikit::FormParts))]
        #[cfg_attr(feature = "server", derive(axum_typed_multipart::TryFromMultipart))]
        #[derive(validator::Validator, apikit::ApiModel)]
        #item
    };
    Ok(expand)
}

pub fn text_expand(item: Item) -> Result<TokenStream> {
    let expand = quote! {
        #[derive(Debug, validator::Validator, apikit::ApiModel, serde::Serialize, serde::Deserialize)]
        #item
    };
    Ok(expand)
}
